package ica_alink

import "time"

// EventReportAsk 事件上报
type EventReportAsk struct {
	BaseAsk
	Params EventDataItem `json:"params"`
}

type EventDataItem struct {
	Value map[string]interface{} `json:"value"`
	Time  int64                  `json:"time"` //单位：毫秒
}

func (ask *EventReportAsk) AddParam(k string, v interface{}) {
	if ask.Params.Value == nil {
		ask.Params.Value = map[string]interface{}{}
		ask.Params.Time = time.Now().UnixMilli()
	}

	ask.Params.Value[k] = v
}
